<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <input class="form-control" placeholder="例如：重要重庆" id="txtChinese" />
            <select class="form-control my-2" multiple id="sePinyin"></select>
            源：<a href="/js/pinyin.js" target="_blank">pinyin.js</a>
        </div>
    </div>
</div>

<script src="/js/pinyin.js" asp-append-version="true"></script>
<script>
    $('#txtChinese').keyup(function () {
        var select = document.getElementById('sePinyin');
        select.options.length = 0;
        if (this.value != "") {
            var arrPY = PY.QueryArray(this.value);
            for (var i = 0; i < arrPY.length; i++) {
                select.options.add(new Option(arrPY[i], arrPY[i]))
            }
        }
    });
</script>